package cn.jingzhuan.fm.mvp.model

import cn.jingzhuan.fm.di.injection.DaggerApplicationComponent
import org.junit.Assert
import org.junit.Test
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit


class AlbumModelTest {


    @Test
    fun getBannerListTest() {
        var cd = CountDownLatch(1)
        var applicationComponent =  DaggerApplicationComponent.builder().build()
        var apiService = applicationComponent.fmApiService()
        var size = 0
        apiService.bannerList().subscribe {
            println(it.response?.size)
            size = it.response?.size
            cd.countDown()
        }
        cd.await(10,TimeUnit.SECONDS)
        Assert.assertTrue(size == 1)
    }

}